import config from 'config'
import httpFetch from 'share/httpFetch'

export default {

  confirmPayment(status, params){
    return httpFetch.post(`${config.baseUrl}/api/reimbursement/batch/${status === 'prending_pay' ? 'pending/pay' : 'paid'}/confirm`, params)
  },

  //取消支付校验
  cancelPayment(status,params,isChecked){
    let url = isChecked ? '/api/reimbursement/batch/check/before/payment/cancel' : '/api/reimbursement/batch/payment/cancel';
    return httpFetch.post(`${config.baseUrl}${url}?statusEnum=${status === 'prending_pay' ? 'INIT' : 'PENDING_PAY'}`, params);
  },

  getPayType(id){
    return httpFetch.get(`${config.baseUrl}/api/comapnyBankPayment/getByBankAccountId?id=${id}&isDefault=true`)
  }

}
